using System;
using System.Collections.Generic;
using System.Text;

namespace TVDesigner.Generator.GeneratorEntities
{
    public class TVDesignerScreenGenerator
    {
        public static String DeclareClass(string package, string xletName)
        {
            StringBuilder sb = new StringBuilder();
            
            //package
            if (package != null && !package.Equals(string.Empty))
            {
                sb.Append("package ").Append(package).Append(";\n\n");
            }

            sb.Append("import org.havi.ui.HContainer;\n");
            sb.Append("import javax.tv.media.AWTVideoSize;\n");

            sb.Append(@"
public abstract class TVDesignerScreen extends HContainer {
    
    protected javax.tv.media.AWTVideoSize awtVideoSize;
    protected TVDesignerScreen lastScreen;
").Append("\tprotected ").Append(xletName).Append(" xlet;\n").Append(@"
    
    public abstract void keyEvent(java.awt.event.KeyEvent event);

    protected void setLastScreen(TVDesignerScreen lastScreen) {
        this.lastScreen = lastScreen;
    }

    public abstract void setXlet(").Append(xletName).Append(" xlet);\n");

    sb.Append("}\n");
            
            return sb.ToString();
        }
    }
}
